package systems.languages;

import java.io.File;
import java.io.FilenameFilter;

/**
 * This class allows us to create a specific filenameFilter in order filter the language files.
 * It's based on the singleton design pattern.
 * @author Baptiste Legrand and Benjamin Orman
 * @version 1.0
 */
public class MultiLanguagesFilter implements FilenameFilter {
  protected String pattern = ".xml";
  private static MultiLanguagesFilter instanceFilter = new MultiLanguagesFilter();
  
  /**
   * Empty class constructor
   */
  private MultiLanguagesFilter () {
  }
 
  public boolean accept (File dir, String name) {
    return name.toLowerCase().endsWith(pattern);
  }
  /**
   * This getter returns the MultiLanguagesFilter instance.
   * @return MultiLanguagesFilter instance.
   */
  public static MultiLanguagesFilter getInstance(){
	  return instanceFilter;
  }
}
